package com.chaochis.springboottestdemo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import java.io.PrintStream;

@SpringBootApplication
@EnableSwagger2
@EnableAspectJAutoProxy
@ServletComponentScan
@EnableAsync
@MapperScan({"com.chaochis.springboottestdemo.**.mapper"})
public class SpringBootTestDemoApplication {

  public static void main(String[] args) {
    var app = new SpringApplication(SpringBootTestDemoApplication.class);
    app.setBannerMode(Banner.Mode.CONSOLE);
    app.setBanner((environment, sourceClass, out) -> out.println(" ************ 你好"));
    app.run(args);
  }

}
